<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<ui:composition template="/design/template.xhtml">
    <ui:define name="body">

      <h:form id="frmCargo" acceptcharset="ISO-8859-1">
      <h:inputHidden id="codigoCargo" value="#{adminCargoAction.cargo.codigo}"/> 
      <p:panel id="pnlCargo" header="Dados cargo">

        <p:spacer height="10" />
        <p:messages id="messages" autoUpdate="true" />

        <h:panelGrid columns="3" cellpadding="4" >

          <h:outputText value="Nome:" styleClass="formLabel" />
          <p:spacer width="6" />
          <p:inputText id="cargoName" value="#{adminCargoAction.cargo.nome}" style="width:250px;"
            required="true" requiredMessage="Nome obrigatório!">
          </p:inputText>

          <h:outputText value="Situação:" styleClass="formLabel" />
          <p:spacer width="6" />
          <p:selectOneMenu id="cargoSituacao" value="#{adminCargoAction.cargo.situacao.codigo}" style="width:158px;" 
                           required="true" requiredMessage="Situação cargo obrigatoria!">  
            <f:selectItem itemValue="" itemLabel="Selecione uma situação"/>  
            <f:selectItems value="#{adminCargoAction.situacaoItems}"/>  
          </p:selectOneMenu>

        </h:panelGrid>
        <p:spacer height="10" />
        <p:outputPanel id="pnlButons">
          <div align="left" id="divButons">
            <p:commandButton action="#{adminCargoAction.listar}" value="cancelar" ajax="false" immediate="true" />
            <p:spacer width="10" />
            <p:commandButton action="#{adminCargoAction.incluir}" update="pnlCargo" value="incluir" ajax="false" rendered="#{adminCargoAction.acaoIncluir}" />
            <p:commandButton action="#{adminCargoAction.alterar}" update="pnlCargo" value="alterar" ajax="false" rendered="#{adminCargoAction.acaoAlterar}" />
          </div>
        </p:outputPanel>			

    </p:panel>
    </h:form>

  </ui:define>
  </ui:composition>
</html>
